<?php
class recommendApi extends baseApi{

	public function hook_menu_expand(){
        return array(
            0 => array('name'=>'推荐位管理','url'=>url('admin_list/index'),'sequence'=>2),
            );
    }

	public function hook_purview_admin()
	{
		return array(
			'admin_list'=>array(
				'name'=>'推荐位管理',
				'auth'=>array(
					'index'=>'列表',
					'add'=>'添加',
					'edit'=>'编辑',
					'del'=>'删除',
				),
			),
		);
	}

	//推荐位列表
	public function recommend_list(){
		return model('recommend')->recommend_list();
	}

	//获取推荐位关联数组
	public function recommend_array($aid){
		return model('recommend_relation')->relation_array($aid);
	}

	//关联内容
	public function content_save($data){
		return model('recommend_relation')->content_save($data['str'],$data['aid']);
	}

	//删除关联内容
	public function content_del($aid){
		return model('recommend_relation')->content_del($aid);
	}

	//获取关联推荐列表
	public function content_list($id){
		return model('recommend')->content_list($id);
	}
	
}